/**
 * User: alesj
 * Date: 2004.8.24
 * Time: 13:01:19
 */

package com.generalynx.ecos.data;

import com.generalynx.common.data.IDirty;
import org.hibernate.LockMode;

import java.io.Serializable;

public interface IAttachable extends IDirty {

    /**
     * get id key
     */
    public Serializable getKey();

    /**
     * get lock mode
     * LockMode.WRITE is illegal
     */
    public LockMode getLockMode();

    /**
     * do we reload object (also becomes part of current Hibernate session)
     * and reattach it to http session
     */
    public boolean doReload();

    /**
     * Is reloaded.
     */
    public boolean isReloaded();

    /**
     * Set reloaded.
     */
    public void setReloaded(boolean reloaded);

}
